package nl.tue.bsdddump;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.util.Properties;

import org.apache.log4j.PropertyConfigurator;

import no.catenda.peregrine.model.objects.IfdConcept;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;

public class Jerseyclient {

	/**
	 * To generate the BsDD Dump
	 */
	public static void main(String[] args) {
		final String baseUrl1 = "http://bsddpilot.catenda.no/api/4.0/IfdConcept/search/";
		
		final String baseUrl = "http://lookup.bsdd.buildingsmart.com/api/4.0";
		
		
		/*Properties props = new Properties();
		
		try {
			props.load(new FileInputStream("log4j.properties"));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		PropertyConfigurator.configure(props);*/
		
		Client client = Client.create();
		
		WebResource resource = client
				.resource("http://bsddpilot.catenda.no/api/4.0/session/login?email=demo&password=demo");
		
		IfdConcept result = client.resource(baseUrl1+"door").get(IfdConcept.class);
				//client.resource(baseUrl1+"door").get(IfdConcept.class);

		System.out.println(result);

	}

}
